<?php
    $this->headTitle('Phân quyền','append');      
?>
<div class="row-fluid page-head">
    <h2 class="page-title"><i class="fontello-icon-monitor"></i> Phân quyền <small></small></h2>
    <p class="pagedesc"></p>
    <div class="page-bar">
        <div class="btn-toolbar"> </div>
    </div>
</div>
<!-- // page head -->

<div id="page-content" class="page-content">
    <nav>   
        <ul class="btn-toolbar page-nav margin-btn">                        
            <?php if($this->acl->checkAllowed(array('moduleName'=>'admin','controllerName'=>'role','actionName'=>'add'))){ ?>
                <li>
                    <a class="btn btn-well btn-glyph" href="<?php echo $this->url(array('module'=>'admin', 'controller'=>'role', 'action'=>'add'))?>" style="width:80px">
                        <i class="fontello-icon-plus f30"></i>
                        <span class="block">Thêm</span>
                    </a>
                </li>
            <?php } ?>                                                 
        </ul>
        <hr class="margin-0x"/>
    </nav>
    <section>
        <div class="row-fluid margin-bottom16">
            <div class="span12">
                <div class="widget widget-simple widget-table">
                    <table id="table-role" class="table boo-table table-striped table-content table-hover dataTable">
                        <thead>
                            <tr>                                
                                <th scope="col">Name <span class="column-sorter"></span></th>
                                <th scope="col">Resource <span class="column-sorter"></span></th>                                
                                <th scope="col">Func <span class="column-sorter"></span></th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php                            
                                foreach ($this->roleList as $role){
                            ?>
                                <tr>                                    
                                    <td>
                                        <?php echo $role['roleName']?>                                                                            
                                    </td>                                    
                                    <td>
                                        <?php echo str_replace(array('[',']','","','"'), array('','',', ',''),$role['resourceId']);?>
                                    </td>
                                    <td>
                                        <?php if($this->acl->checkAllowed(array('moduleName'=>'admin','controllerName'=>'role','actionName'=>'edit'))){ ?>
                                            <a class="btn btn-mini btn-glyph btn-yellow" href="<?php echo $this->url(array('module'=>'admin', 'controller'=>'role', 'action'=>'edit', 'id'=>$role['roleId']))?>"><i class="fontello-icon-edit-2"></i></a>                                            
                                        <?php } ?>                                                                                
                                            &nbsp;&nbsp;
                                        <?php if($this->acl->checkAllowed(array('moduleName'=>'admin','controllerName'=>'role','actionName'=>'delete'))){ ?>                                    
                                            <a class="btn btn-mini btn-glyph btn-red" href="<?php echo $this->url(array('module'=>'admin', 'controller'=>'role', 'action'=>'delete', 'id'=>$role['roleId']))?>"><i class="fontello-icon-trash-2"></i></a>
                                        <?php } ?>
                                    </td>
                                </tr>                            
                            <?php
                            	}
                            ?>
                        </tbody>
                    </table>
                    <!-- // DATATABLE -->
                </div>
            </div>
        </div>                            
    </section>    
</div>
<!-- // page content -->